import 'package:flutter/material.dart';

// ignore: use_key_in_widget_constructors
class BasicDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      // color: Colors.grey[100],
      decoration: BoxDecoration(
        image: DecorationImage(
          image: const NetworkImage('https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F26410755-97f5-44b9-a7bf-d7c225df5457%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1707378390&t=1ec942023b6496f4c9a798b4c6aacd6b'),
          alignment: Alignment.topCenter,
          fit: BoxFit.cover,
          colorFilter: ColorFilter.mode(
            Colors.indigoAccent[400]!.withOpacity(0.5),
            BlendMode.hardLight,
          ),
        ),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Container(
            padding: const EdgeInsets.all(16),
            margin: const EdgeInsets.all(8),
            width: 90,
            height: 90,
            decoration: BoxDecoration(
              color: const Color.fromRGBO(3, 54, 255, 1),
              border: Border.all(
                color: const Color.fromARGB(255, 68, 105, 253),
                width: 6,
                style: BorderStyle.solid,
              ),
              // borderRadius: BorderRadius.circular(16),
              boxShadow: const [
                BoxShadow(
                  offset: Offset(8, 9),
                  color: Color.fromRGBO(16, 20, 188, 1),
                  blurRadius: 3.0,
                  spreadRadius: -3,
                ),
              ],
              shape: BoxShape.circle,
              // gradient: const RadialGradient(
              //   colors: [
              //     Color.fromRGBO(7, 102, 255, 1),
              //     Color.fromRGBO(3, 28, 128, 1)
              //   ],
              // ),
              gradient: const LinearGradient(
                colors: [
                  Color.fromRGBO(7, 102, 255, 1),
                  Color.fromRGBO(3, 28, 128, 1),
                ],
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter,
              ),
            ),
            
            child: const Icon(
              Icons.pool,
              size: 32,
              color: Color.fromARGB(255, 254, 255, 255),
            ),
          ),
        ],
      ),
    );
  }
}

class RichTextDemo extends StatelessWidget {
  const RichTextDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return RichText(
      text: const TextSpan(
        text: 'Duding',
        style: TextStyle(
          color: Colors.blue,
          fontSize: 34.0,
          fontStyle: FontStyle.italic,
          fontWeight: FontWeight.w100,
        ),
        children: [
          TextSpan(
              text: 'Wang',
              style: TextStyle(
                fontSize: 17.0,
                color: Colors.amber,
              )),
        ],
      ),
    );
  }
}

class TextDemo extends StatelessWidget {
  final TextStyle _textStyle = const TextStyle(
    fontSize: 16.0,
  );

  final String _author = '李白';
  final String _title = '将进酒';

  const TextDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return Text(
      '《$_author》---- $_title。这个错误信息表明 Dart 的分析服务器在过去3分钟内崩溃了5次，并且由于某种原因，它没有被自动重启。这可能是由于多种原因，包括但不限于内存不足、配置问题、代码错误等。',
      textAlign: TextAlign.left,
      style: _textStyle,
    );
  }
}
